package com.briup.jz.web.controller;
import com.briup.jz.bean.AccountEmployee;
import com.briup.jz.bean.AccountSystem;
import com.briup.jz.service.IAccountSystemService;
import com.briup.jz.utils.Message;
import com.briup.jz.utils.MessageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("accountsysytem")
@Api(description="系统账户明细信息")
public class IAccountSystemController {

  @Autowired
    private IAccountSystemService iAccountSystemService;
    @ApiOperation("新建系统账户明细信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferMoney" ,value = "金额", paramType = "form"),
            @ApiImplicitParam(name = "description" ,value = "描述", paramType = "form"),
            @ApiImplicitParam(name = "type" ,value = "类型", paramType = "form"),
            @ApiImplicitParam(name = "status" ,value = "状态", paramType = "form"),
    })
    @PostMapping("/saveorupdate")
    public Message saveOrUpdate(AccountSystem accountSystem){
        iAccountSystemService.save(accountSystem);
        return MessageUtil.success("操作成功");
    }
    @ApiOperation("查询系统账户明细信息")
    @GetMapping("/query")
    public Message query(Long id){
        AccountSystem accountSystem = iAccountSystemService.query(id);
        return MessageUtil.success(accountSystem);
    }
    @ApiOperation("删除系统账户明细信息")
    @GetMapping("delete")
    public  Message delete(Long id){
        iAccountSystemService.deleteById(id);
        return  MessageUtil.success("操作成功");
    }
}
